#include<linux/init.h>
#include<linux/module.h>
#include<linux/kernel.h>
#include<linux/fs.h>
#include<base.h>
 

static int test_open(struct inode * inode, struct file * filp)
{
	return  0;
}
static int __init test_init (void)
{
	static struct file_operations fops = {
		.open = test_open,
	}; 
	register_chrdev(200, "wang_test", &fops); 
	devfs_mk_cdev(MKDEV(200,1), S_IFCHR|S_IRUSR, "wang_test"); 
	printk("hello kernel\n");
	return 0;
}
 
static void __exit test_exit (void)
{
	unregister_chrdev(200, "wang_test"); 
	printk("goodbye kernel\n");
}
 
module_init(test_init);
module_exit(test_exit);
MODULE_LICENSE("GPL");
